<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: function.products_gallery.php 135 2013-09-22 07:30:55Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 135 $
* 	zuletzt geaendert von:	$Author: siekiera $
* 	Datum:					$Date: 2013-09-22 07:30:55 +0000 (Sun, 22 Sep 2013) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright (c) since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */

function smarty_function_products_gallery($params=array(), &$smarty) {
	global $db, $product;
		
	$pID = $params['products_id'];
	unset($params['products_id']);
	
	$c  = '	<div data-role="page" id="products_images" class="gallery-page">
				<div data-role="header" data-theme="b">
					<a data-icon="arrow-l" data-rel="back" data-theme="c">zurück</a>
					<h3>&nbsp;</h3>
				</div>
				<div data-role="content">
					<p>'.$product->data['products_name'].' Produktbilder</p>
					<ul class="gallery">';
		$c .= '			<li>
							<a rel="external" href="'.DIR_WS_POPUP_IMAGES.$product->data['products_image'].'">
								<img src="'.DIR_WS_INFO_IMAGES.$product->data['products_image'].'" />
							</a>
						</li>';
	
		$mo_images = $db->db_query("SELECT
										image_id, image_nr, image_name
									FROM
										".TABLE_PRODUCTS_IMAGES."
									WHERE
										products_id = '".$pID."'
									ORDER BY
										image_nr", true);
		
		if($mo_images->_numOfRows) {		
					while(!$mo_images->EOF) {
			$c .= 		'<li>
							<a href="'.DIR_WS_POPUP_IMAGES.$mo_images->fields['image_name'].'" rel="external">
								<img src="'.DIR_WS_INFO_IMAGES.$mo_images->fields['image_name'].'" />
							</a>
						</li>';
						$mo_images->MoveNext();
					}
		}
		$c .=		'</ul>
				</div>
				<div data-role="footer" data-theme="b">
					<h4>&copy; '.date('Y').' SEO:mercari</h4>
				</div>
			</div>';
	return $c;
}